package twelfth.数据操作流;

import java.io.DataOutputStream;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;

public class 将订单数据写入到文件中 {
    public static void main(String[] args) throws IOException {
        File file = new File("D:\\WorkSpaces\\JavaDevelopBase_start_329\\src\\twelfth\\DataOutoutStream.txt");
        DataOutputStream dos =new DataOutputStream(new FileOutputStream(file));
        String[] names={"pairs","gloves","scanf"};
        Float [] prices ={11.1f,22.2f,33.3f};
        int [] nums ={2,4,6};
        for (int i =0;i<3;i++){
            dos.writeChars(names[i]);
            dos.writeChar('\t');
            dos.writeFloat(prices[i]);
            dos.writeChar('\t');
            dos.writeInt(nums[i]);
            dos.write('\n');
        }
        dos.close();
    }
}
